package com.rhtchr.angelbaby.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * 文章段落。一个段落包含一个段落标题，段落内容。
 * 
 * @author limingju
 * 
 */
@Entity
@Table(name = "t_paragraph")
public class Paragraph {

	private int id;

	private Integer parentId;
	private int level;
	// 所属文章唯一标识
	private Integer articleId;
	// 段落标题
	private String title;
	// 段落内容
	private String content;

	private boolean contentNewLine = false;

	public Paragraph() {
		super();
	}

	@Column(name = "article_id")
	public Integer getArticleId() {
		return articleId;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "id")
	public int getId() {
		return id;
	}

	@Column(name = "parent_id")
	public Integer getParentId() {
		return parentId;
	}

	@Column(name = "title", length = 1024)
	public String getTitle() {
		return title;
	}

	@Column(name = "content_new_line")
	public boolean isContentNewLine() {
		return contentNewLine;
	}

	public void setArticleId(Integer articleId) {
		this.articleId = articleId;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public void setContentNewLine(boolean contentNewLine) {
		this.contentNewLine = contentNewLine;
	}

	public void setId(int id) {
		this.id = id;
	}

	public void setParentId(Integer parentId) {
		this.parentId = parentId;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name = "content", length = 4096)
	public String getContent() {
		return this.content;
	}

	@Column(name = "paragraph_level")
	public int getLevel() {
		return level;
	}

	public void setLevel(int level) {
		this.level = level;
	}
}
